<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:fs="http://www.wueasy.com">
<head>
	<head th:include="layout :: header" th:remove="tag"/>
	<div th:include="layout :: frame" th:remove="tag"/>
</head>
<body>
  <div class="layui-fluid">  
  <div class="layui-row layui-col-space10">
    <div class="layui-col-md3">
    	<div class="layui-card">
    		<div class="layui-card-header">角色管理</div>
    		<div class="layui-card-body">
    			<blockquote class="layui-elem-quote layui-quote-nm layui-quote-warn">温馨提示：鼠标点击右键即可进行角色管理</blockquote>
    			<ul id="treeDemo" class="ztree fsTree" fs:authorize="" funcNo="S1023" isRoot="0" clickCallbackId="fsDatagrid,treeDemo2,treeDemo3" clickCallbackInputs="roleId:" treeIdKey="roleId" treePIdKey="parentId" treeName="roleName"></ul>
<!--          	鼠标右键菜单配置 -->
       			<div class="fsTreeRightMenu">
       				<p function="refresh" icon="refresh" name="刷新"></p>
       				<p function="top" icon="add" name="新增" fs:authorize="" th:topUrl="@{/frame/system-role-add}" topUrl="/frame/system-role-add" topWidth="700px" topHeight="320px" topTitle="新增角色信息" inputs="parentId:$roleId"></p>
       				<p function="top" icon="edit" name="编辑" fs:authorize="" th:topUrl="@{/frame/system-role-edit}" topUrl="/frame/system-role-edit" topWidth="700px" topHeight="320px" topTitle="编辑角色信息" inputs="roleId:" disabledType="rootNode"></p>
       				<p function="submit" icon="del" name="删除" fs:authorize="" funcNo="S1027" isConfirm="1" confirmMsg="是否确定删除？" inputs="roleId:" disabledType="parent|rootNode"></p>
       			</div>
    		</div>
    	</div>
    </div>
    
    <div class="layui-col-md9">
    	<div class="layui-card">
    		<div class="layui-card-header">权限管理</div>
    		<div class="layui-card-body">
    			<div class="layui-tab layui-tab-brief">
				  <ul class="layui-tab-title">
				    <li class="layui-this">用户权限</li>
				    <li>菜单权限</li>
				    <li>数据权限</li>
				  </ul>
				  <div class="layui-tab-content">
				  	<div class="layui-tab-item layui-show">
					  	<div class=" layui-col-space1">
					    	<div id="table_buttion_div">
					    		<form id="query_form" class="layui-form">
					    			<input type="hidden" id="roleId" name="roleId" value=""/>
					    			<div class="layui-form-item">
										<div class="layui-inline">
											<label class="layui-form-mid">登录名：</label>
											<div class="layui-input-inline" style="width: 100px;">
												<input type="text" name="loginNo" autocomplete="off" class="layui-input"/>
											</div>
										</div>
										<div class="layui-inline">
											<label class="layui-form-mid">姓名：</label>
											<div class="layui-input-inline" style="width: 100px;">
												<input type="text" name="username" autocomplete="off" class="layui-input"/>
											</div>
										</div>
										<div class="layui-inline">
											<div class="layui-input-inline">
												<button class="layui-btn layui-btn-sm" type="button" function="query"><i class="layui-icon layui-icon-search"></i>查询</button>
											</div>
										</div>
									</div>
					    		</form>
						    	<button class="layui-btn layui-btn-sm" fs:authorize="" function="top" selectTreeId="roleId" th:topUrl="@{/frame/system-role-userList}" topUrl="/frame/system-role-userList" topWidth="800px" topHeight="450px" topTitle="用户列表" inputs="roleId:#roleId">
								  <i class="layui-icon layui-icon-add-1"></i>选择用户
								</button>
								<button class="layui-btn layui-btn-sm" function="refresh" selectTreeId="roleId">
								  <i class="layui-icon layui-icon-refresh-1"></i>刷新
								</button>
					    	</div>
					    </div>
					    <div class=" layui-col-space1">
							<table id="fsDatagrid" class="fsDatagrid" lay-filter="fsDatagrid" fs:authorize="" funcNo="S1028" isPage="1" isLoad="0" defaultForm="query_form" height="full-245">
							</table>
							
							<div class="fsDatagridCols">
								<p type="numbers" title="#"/>
							    <p field="loginNo" title="登录名" width="200" sort="true"/>
							    <p field="username" title="用户姓名" width="300"/>
							    <p fixed="right" align="center" toolbar="#barDemo" title="操作" width="100"/>
							</div>
							<script type="text/html" id="barDemo">
								<a id="del" class="layui-btn layui-btn-danger layui-btn-xs" fs:authorize="" lay-event="submit" funcNo="S1030" isConfirm="1" inputs="id:,roleId:"><i class="layui-icon layui-icon-delete"></i>删除</a>
							</script>
					    </div>
					  </div>
					<div class="layui-tab-item">
						<form id="query_form2" style="display: none;">
			    			<input type="text" id="roleId2" name="roleId" value="0"/>
			    		</form>
						<button class="layui-btn layui-btn-sm fsTree" funcNo="S1033" fs:authorize="" function="submit" isRefresh="0" selectTreeId="roleId2" inputs="ids:$id,roleId:#roleId2" treeId="treeDemo2">
						  <i class="fa fa-floppy-o" aria-hidden="true"></i> 保存权限
						</button>
						<hr/>
						<ul id="treeDemo2" class="ztree fsTree" fs:authorize="" funcNo="S1032" isRoot="0" isLoad="0" checkType="checkbox" treeIdKey="id" treePIdKey="parentid" treeName="name" defaultForm="query_form2"></ul>
					</div>
					<div class="layui-tab-item">
						<form id="query_form3" class="layui-form">
							<input type="hidden" id="roleId3" name="roleId" value="0"/>
							<div class="layui-form-item">
								<div class="layui-inline">
									<div class="layui-input-inline">
										<select id="modelId" name="modelId" class="fsDict" lay-filter="modelId" dict="authDataModel">
										</select>
									</div>
								</div>
							</div>
			    		</form>
						<button class="layui-btn layui-btn-sm fsTree" funcNo="S1106" fs:authorize="" function="submit" isRefresh="0" selectTreeId="roleId3" inputs="ids:$id,roleId:#roleId3,modelId:#modelId" treeId="treeDemo3">
						  <i class="fa fa-floppy-o" aria-hidden="true"></i> 保存数据权限
						</button>
						<hr/>
						<ul id="treeDemo3" class="ztree fsTree" fs:authorize="" funcNo="S1105" isRoot="0" isLoad="0" checkType="checkbox" treeIdKey="id" treePIdKey="parentId" treeName="name" defaultForm="query_form3"></ul>
					</div>
				</div>   
	         	</div>
    		</div>
    	</div>
    </div>
  </div>
</div>
<script type="text/javascript">
layui.fsCallback.form.query_form3 = function(thisForm){
	layui.form.on('select(modelId)', function(data){
	  var param = {};
	  param["modelId"] = data.value;
	  thisForm.getTree("treeDemo3").query(param);
	});
}
</script>
</body>
</html>